<template>
  <div class="subject">
    <div v-for="(item, index) in math" :key="index">
      <span>{{ item.first }}</span>
      <span>+</span>
      <span>{{ item.second }}</span>
      <span>=</span>
      <input type="number" />
      <button>提交</button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      math: [
        {
          first: Math.floor(Math.random * 10),
          second: Math.floor(Math.random * 10),
        },
        {
          first: Math.floor(Math.random * 10),
          second: Math.floor(Math.random * 10),
        },
        {
          first: Math.floor(Math.random * 10),
          second: Math.floor(Math.random * 10),
        },
        {
          first: Math.floor(Math.random * 10),
          second: Math.floor(Math.random * 10),
        },
        {
          first: Math.floor(Math.random * 10),
          second: Math.floor(Math.random * 10),
        },
      ],
    };
  },
};
</script>

<style scoped>
.subject {
  margin: 5px;
  padding: 5px;
  font-size: 20px;
}
.subject span {
  display: inline-block;
  text-align: center;
  width: 20px;
}
.subject input {
  width: 50px;
  height: 20px;
}
</style>
